package cn.cyan.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

/**
 * @author LWQ
 * @Description:
 */
@RestController
@RequestMapping("/html")
public class HtmlController {

    @GetMapping("/ccc")
    public String htmlStyle() {
        try {
            return readFileContent("D:\\Desktop\\68.txt");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static String readFileContent(String filePath) throws IOException {
        return new String(Files.readAllBytes(Paths.get(filePath)));
    }

    public static void main(String[] args) {
        try {
            String fileContent = readFileContent("D:\\Desktop\\68.txt");
            System.out.println(fileContent);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
